new Settings API : read write settings#875
Open
john-peterson wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
replacement for settings app
adb only required once
then you can finally apply the settings you need with out adb and wifi
notice about regular settings
you may already know this
this permission is set from settings app GUI and can't be set from command
it returned some kind of cryptic error that I googled and learned it was in the GUI
example usage
first create this function in shell
string appears to work for int also
but not the other way around
this illustrate a deleted or null value with JSON output . an empty array
and the new single line non JSON plain text output .that I changed to but can be easily changed back . except the extra messages may look weird in JSON
set empty string same as delete
if you want to restore default there is no delete
in the API only blank string but the effect is the same
the return value is null from empty string
but I haven't verified this in adb because I could only use it for a minute to set permission for termux user
service settings are impossible from API
GUI settings like dark mode and navigation is not controlled by a setting but a service
I constantly need to change this from GUI when I put my phone in travel pouch
and take it out again
and it would be faster from command but it's impossible outside adb
this service is visible but the setting seems to be restricted to system apps
and the equivalent API
I haven't tried this because I never have wifi to test anything in adb
it may be restricted to system apps if I try to set it from adb
more about battery saver especially day night mode
now I can finally change battery saver settings . especially the disaster
and it's constantly deleted on my unisoc phones both of them that otherwise works nearly perfectly
they are called Hisense in south Africa and umidigi in Canada but they are essentially the same phone usually the top seller on Amazon . at least it was in Canada i was lucky to get it again for only 150 Canadian . and in stores in south Africa at least where I bought it first for around two hundred Canadian or 150 euros
searching this problem others have also complained that this setting is reverted constantly and you have to set it every time you need it
I had only one phone on a six months food and tent expedition in Australia and the sun panel broke and caused a disaster . I had to complete this app when I returned to a bike food tent expedition Canada and had a connection and battery again
and also my alarm timeout patch for termux to make sure it's not left running in the back ground
check battery policy before and after setting
on my unisoc phones battery saver constants is null by default
save four different files with battery saver on and off and night mode true or false
do this four times for four different files
to verify and compare before and after with diff to make sure you didn't change anything else in the policy except the night mode
the other battery saver setting
here is another battery setting I have never used or heard of
maybe this one is not reset all the time except at reboot
I haven't had time to try it until writing this
keep battery saver on while charging
some one claimed this would be permanent even after I unplug charging
or in this case
setting this manually somehow magically keep it on while plugged in
this makes absolutely no sense and I haven't tried it but I am looking for a way to always save battery since I always lack it
I have no idea why that should be the case and don't believe it
I will try to set it and check if battery saver policy is still enable
but some one should explain how could it have any idea what enabled it . or how it was enabled by the system or GUI or API
what I would expect is that the system always set it to 0 when battery is connected to charging
to restore the automatic battery saver off when charging I'm supposed to do
this is only available adb . this error is outside adb
but I'm not worried about losing it completely or always have it on while plugged in even but I doubt it's possible
they are not listening really to the right people or minorities or important minorities
just because I have a power source doesn't mean I'm home I could still be on expedition
after testing this stupid idea I find that
settings app is completely blocking battery saver when. plugged in everything is greyed out
when I plug in i get this message as I suspected this idea makes no sense whatsoever
if I run this
while plugged in nothing happens in log from power manager that should report on
unlike wifi the setting is not immediately restored to 0 but it's ignored by power manager as I suspected . another fail for Google AI
I see nothing in policy that would indicate this is possible
it only says battery is not low probably because I'm charging
I don't even know what that value means
confused with sticky battery saver restored when unplugged
I think they are talking about or have confused it with sticky mode that I already have
it only means battery saver comes back after unplugged
if you keep it plugged in all night battery will drain like crazy because battery saver is disabled
PATCH local adb with out wifi please merge this team mankind
I have prepared these rough outlines for a patch for local ADB access on all phones
john-peterson/platform_packages_apps_settings@adb
john-peterson/platform_frameworks_base@adb
I don't know if user/project@branch is resolved so here are the whole links for the GUI . cli still has no links only a static page
https://github.com/john-peterson/platform_packages_apps_settings/commits/adb
https://github.com/john-peterson/platform_frameworks_base/commits/adb
I'm struggling against this response
these sayings come to mind . different worlds . different strokes . a world apart . Romeo and Juliet
they struggle to understand some people don't have wifi and almost never any connection at all
I have written a long letter on Gerrit and hopefully this patch will land some day for all phones
I looked for these wifi hooks and tried to remove the call back that disable adb demon when wifi state change to disconnect
adb sources that I forked
aosp-mirror/platform_packages_apps_settings:src/com/android/settings/development
aosp-mirror/platform_frameworks_base:services/core/java/com/android/server/adb
and ADB native source that doesn't seem to need any patch
https://android.googlesource.com/platform/packages/modules/adb
it's impossible to even connect again with no wifi
even if you are paired it's impossible to connect again all these fail with out wifi
if it's off I'm pretty sure this is not allowed but I haven't tried it
they plugged all the holes . there is no way to get ADB back with out wifi
notice it return true despite the error or rather info message in the log
even if you got this far if you check the source only the port is written in log not the pairing code
I don't know any other way to get the adb port all network status access is blocked